package com.ruowei.modules.foodOrder.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;

import java.io.Serializable;

/**
 * 购物车表
 */
@ApiModel(description = "购物车表")
@Entity
@Table(name = "shopping_cart")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class ShoppingCart implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 购物车编码
     */
    @ApiModelProperty(value = "购物车编码")
    @Column(name = "cart_code")
    private String cartCode;

    /**
     * 用户编码
     */
    @ApiModelProperty(value = "用户编码")
    @Column(name = "member_code")
    private String memberCode;

    /**
     * 商品编码
     */
    @ApiModelProperty(value = "商品编码")
    @Column(name = "merchandise_code")
    private String merchandiseCode;

    /**
     * 商品名称
     */
    @ApiModelProperty(value = "商品名称")
    @Column(name = "merchandise_name")
    private String merchandiseName;

    /**
     * 商家编码
     */
    @ApiModelProperty(value = "商家编码")
    @Column(name = "merchant_code")
    private String merchantCode;

    /**
     * sku编码
     */
    @ApiModelProperty(value = "sku编码")
    @Column(name = "sku_code")
    private String skuCode;

    /**
     * 商品数量
     */
    @ApiModelProperty(value = "商品数量")
    @Column(name = "merchandise_quantity")
    private Integer merchandiseQuantity;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCartCode() {
        return cartCode;
    }

    public ShoppingCart cartCode(String cartCode) {
        this.cartCode = cartCode;
        return this;
    }

    public void setCartCode(String cartCode) {
        this.cartCode = cartCode;
    }

    public String getMerchandiseName() {
        return merchandiseName;
    }

    public void setMerchandiseName(String merchandiseName) {
        this.merchandiseName = merchandiseName;
    }

    public String getMemberCode() {
        return memberCode;
    }

    public ShoppingCart memberCode(String memberCode) {
        this.memberCode = memberCode;
        return this;
    }

    public void setMemberCode(String memberCode) {
        this.memberCode = memberCode;
    }

    public String getMerchandiseCode() {
        return merchandiseCode;
    }

    public ShoppingCart merchandiseCode(String merchandiseCode) {
        this.merchandiseCode = merchandiseCode;
        return this;
    }

    public void setMerchandiseCode(String merchandiseCode) {
        this.merchandiseCode = merchandiseCode;
    }

    public String getMerchantCode() {
        return merchantCode;
    }

    public ShoppingCart merchantCode(String merchantCode) {
        this.merchantCode = merchantCode;
        return this;
    }

    public void setMerchantCode(String merchantCode) {
        this.merchantCode = merchantCode;
    }

    public String getSkuCode() {
        return skuCode;
    }

    public ShoppingCart skuCode(String skuCode) {
        this.skuCode = skuCode;
        return this;
    }

    public void setSkuCode(String skuCode) {
        this.skuCode = skuCode;
    }

    public Integer getMerchandiseQuantity() {
        return merchandiseQuantity;
    }

    public ShoppingCart merchandiseQuantity(Integer merchandiseQuantity) {
        this.merchandiseQuantity = merchandiseQuantity;
        return this;
    }

    public void setMerchandiseQuantity(Integer merchandiseQuantity) {
        this.merchandiseQuantity = merchandiseQuantity;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof ShoppingCart)) {
            return false;
        }
        return id != null && id.equals(((ShoppingCart) o).id);
    }

    @Override
    public int hashCode() {
        return 31;
    }

    @Override
    public String toString() {
        return "ShoppingCart{" +
            "id=" + getId() +
            ", cartCode='" + getCartCode() + "'" +
            ", memberCode='" + getMemberCode() + "'" +
            ", merchandiseCode='" + getMerchandiseCode() + "'" +
            ", merchantCode='" + getMerchantCode() + "'" +
            ", skuCode='" + getSkuCode() + "'" +
            ", merchandiseQuantity=" + getMerchandiseQuantity() +
            "}";
    }
}
